<script language="javascript" src="/Public/static/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<div id="main-content">
    <div id="main" class="main">
			<div class="user-hd">
                <h2>财务管理>>{$page_title}</h2>
            </div>
		<div class="clearfix searchspin">
			<dl>
				<dt>筛选条件:</dt>
				<dd>		
				<form action="{:U('Admin/Cinema/acountList')}" method="get">

				开通时间：<input type="text" name="create_time_start" id="create_time_start" value="{$_GET['create_time_start']}" class="Wdate bg-input mr5" <literal>onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'create_time_end\')||\'%y-%M-%d\'}'})"</literal> readonly="readonly" size="30" style="width: 90px;"/>
                        <input type="text" name="create_time_end" id="create_time_end" value="{$_GET['create_time_end']}" class="Wdate bg-input mr5" <literal>onfocus="WdatePicker({minDate:'#F{$dp.$D(\'create_time_start\')}',maxDate:'%y-%M-%d'})"</literal> readonly="readonly" size="30" style="width: 90px;" />
				影院状态：
				<select name="status" class="" style="height:30px;">
				  <option value="0" <eq name="params.status" value="0">selected</eq> >-</option>
				  <option value="1" <eq name="params.status" value="1">selected</eq> >使用中</option>
				  <option value="2" <eq name="params.status" value="2">selected</eq> >已停用</option>
				</select>
<!-- 				服务器状态：
				<select name="hoststatus" class="" style="height:30px;">
				  <option value="0" <eq name="params.hoststatus" value="0">selected</eq> >-</option>
				  <option value="1" <eq name="params.hoststatus" value="1">selected</eq> >正常</option>
				  <option value="2" <eq name="params.hoststatus" value="2">selected</eq> >异常</option>
				</select> -->					
				<input type="text" maxlength="36" name="keywords" value="{$params['keywords']}" placeholder="主机名称或影院名称..." class="bg-input">
				<a href="{:U('Admin/Cinema/acountList')}" class="sblue-btn" style="height:28px;width:68px;">清空 </a>
				<input type="submit" class="sblue-btn" value="检索">
				<input type="hidden" name="id" value="">
				<div class="clear"></div>
				</form>
				</dd>
			</dl>
		</div>		
        <div class="spin-cont">	
            <table>
                <tr>
                    <th class="spin-tit" style="width: 160px;">主机名</th>
                    <th class="spin-tit" style="width: 160px;">影院名称</th>
                    <th style="width: 130px;">开通时间</th>
                    <th style="width: 130px;">每期扣费总计</th>
                    <th style="width: 130px;">本期扣费截止日期</th>
                    <th style="width: 100px;">账户余额</th>
					<th style="width: 100px;">影院状态</th>
                    <th style="width: 220px;">操作</th>
                </tr>
                <volist name="data_list_data[data_list]" id="vo">
                <tr>
                    <td class="spin-tit">{$vo.host_name}</td>
                    <td class="spin-tit">{$vo.cinema_name|default='--'}</td>
                    <td>{$vo.join_time|date='Y-m-d', ###}</td>
                    <td><?php echo  $vo['hall_price']*$vo['buy_hall_count']*$vo['deduct_period'] ;?></td>
                    <td><?php if(empty($vo['last_cost_time'])) $vo['last_cost_time'] = $vo['join_time']; echo date("Y-m-d",$vo['last_cost_time']+($vo['deduct_period']*31*86400));  ?></td>
					<td>{$vo.money}</td>
                    <td>
						<switch name="vo.status">
							<case value="1"><font color="green">使用中</font></case>
							<case value="2"><font color="red">已停用</font></case>
						</switch>	
					</td>
                    <td>
                        <a href="{:U('Cinema/changeRecharge', array('id'=>$vo[id]))}" class="delfilebtn" >计费变更</a>					
                        &nbsp; | &nbsp;
                        <a href="{:U('Cinema/detail', array('id'=>$vo[id]))}" class="delfilebtn" >详情</a>					
                        <if condition="(0 LT $vo[recharge_method_id]) OR (0 LT $vo[hall_price])">
                        &nbsp; | &nbsp;
                        <a href="{:U('Cinema/recharge', array('id'=>$vo[id]))}" class="delfilebtn" >充值申请</a>
                        </if>
                        &nbsp; | &nbsp;
                        <a href="{:U('Cinema/userRechargeList', array('id'=>$vo[id]))}" class="delfilebtn" >交易记录</a>

                    </td>
                </tr>
                </volist>
            </table>
            <div class="page txt-center">
                {$data_list_data.pager}
            </div>
        </div>
    </div>
</div>
<script language="javascript">
    function initPassword(url, message)
    {
        swal({
            title: message,
            text: "",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#0C7AB9",
            cancelButtonText: "取消",
            confirmButtonText: "确定",
            closeOnConfirm: false
            },
            function(){
                $.ajax({
                    type:'post',
                    dataType:'json',
                    url: url,
                    success:function(data){
                        if (data.status==1) {
                            alertMessage(data.info, 1, 2);
                            if (data.url) {
                                delayGoToPage(data.url, 2000);
                            }
                        }else{
                            alertMessage(data.info, '', 2);
                        }
                    }
                });
            }
        );
    }
</script>